<template>
  <el-card shadow="never">
    <el-collapse-transition>
      <el-form ref="query" v-if="searchShow" :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
        <!--文本框-->
        <el-form-item>
          <el-input v-model="dataForm.bizId" placeholder="业务id" clearable></el-input>
        </el-form-item>
        <!--文本框-->
        <el-form-item>
          <el-input v-model="dataForm.procInstId" placeholder="流程id" clearable></el-input>
        </el-form-item>
        <el-form-item>
          <el-input v-model="dataForm.creator" placeholder="操作人" clearable></el-input>
        </el-form-item>
        <!--文本框-->
        <el-form-item>
          <el-select v-model="dataForm.type" placeholder="操作类型" clearable>
            <el-option v-for="template in $getDictList('BPM_LOG_TYPE', true)" :key="template.val"
              :label="template.label" :value="template.val"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="getDataList()">{{ $t('query') }}</el-button>
          <el-button @click="searchReset()">{{ $t('reset') }}</el-button>
        </el-form-item>
      </el-form>
    </el-collapse-transition>
    <vxe-toolbar :custom="{immediate:true}">
      <template v-slot:buttons>
        <!-- <el-button v-if="$hasPermission('bpm:bpmLog:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}
        </el-button>
        <el-button v-if="$hasPermission('bpm:bpmLog:delete')" type="danger" @click="deleteHandle()">
          {{ $t('deleteBatch') }}</el-button> -->
      </template>
      <template v-slot:tools>
        <el-button icon="el-icon-search" @click="searchShowHandle()" circle></el-button>
        <el-button icon="el-icon-refresh" @click="getDataList()" circle></el-button>
        <!-- <el-button icon="el-icon-download" @click="exportHandle()" circle></el-button> -->
      </template>
    </vxe-toolbar>
    <!--  锁定表头设置   :height="this.tableHeight" -->
    <vxe-table ref="xTable" :loading="dataListLoading" class="vxe-table-element" auto-resize
      :sort-config="{trigger:'cell'}" @sort-change="sortChange" @select-change="dataListSelectionChangeHandleVex"
      @select-all="dataListSelectionAllChangeHandleVex" :data="dataList">
      <vxe-table-column type="index" align="center" width="60"></vxe-table-column>
      <vxe-table-column field="bizId" title="业务id">
      </vxe-table-column>
      <vxe-table-column field="procInstId" title="流程id">
      </vxe-table-column>
      <vxe-table-column field="type" title="操作类型" width="100">
        <template slot-scope="scope">
          {{$getDictLabel('BPM_LOG_TYPE', scope.row.type)}}
        </template>
      </vxe-table-column>
      <vxe-table-column field="procParams" title="操作参数">
      </vxe-table-column>
      <vxe-table-column field="creator" title="创建者">
      </vxe-table-column>
      <vxe-table-column field="createDate" title="创建时间" width="140" align="center">
      </vxe-table-column>
      <!-- <vxe-table-column title="handle" width="120" show-overflow="false" fixed="right" align="center">
        <template slot-scope="scope">
          <el-button v-if="$hasPermission('bpm:bpmLog:update')" type="text" size="small" icon="el-icon-edit"
            @click="addOrUpdateHandle(scope.row)">{{ $t('update') }}</el-button>
          <el-button v-if="$hasPermission('bpm:bpmLog:delete')" type="text" size="small" icon="el-icon-delete"
            @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
        </template>
      </vxe-table-column> -->
    </vxe-table>
    <el-pagination :current-page="page" :page-sizes="pageSizes" :page-size="limit" :total="total"
      layout="total, sizes, prev, pager, next, jumper" @size-change="pageSizeChangeHandle"
      @current-change="pageCurrentChangeHandle">
    </el-pagination>
  </el-card>
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
export default {
  mixins: [mixinViewModule],
  data () {
    return {
      searchShow: true,
      mixinViewModuleOptions: {
        getDataListURL: '/bpm/bpmLog/page',
        getDataListIsPage: true,
        deleteURL: '/bpm/bpmLog',
        deleteIsBatch: true,
        exportURL: '/bpm/bpmLog/export'
      },
      headLock: false,
      dataForm: {
        bizId: '',
        procInstId: '',
        type: '',
        creator: ''
      }
    }
  },
  components: {
  },
  methods: {
    // 新增 / 修改
  }
}
</script>
